﻿@If Request.IsAuthenticated Then
    @<div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <a class="brand" href="@Href("~/")">Azox</a>
                <div class="nav-collapse collapse">
                    <ul class="nav">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Материалы&nbsp;<b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li>
                                    @Html.ActionLink("Страницы", "index", "pages", New With {.area = "admin"}, Nothing)
                                </li>
                                <li>
                                    @Html.ActionLink("Файлы", "index", "files", New With {.area = "admin"}, Nothing)
                                </li>
                            </ul>
                        </li>
                    </ul>
                    <ul class="nav pull-right">
                        @If Not String.IsNullOrEmpty(ViewBag.EditUrl) Then
                            @<li><a href="@ViewBag.EditUrl"><i class="icon-pencil"></i>&nbsp;Редактировать</a></li>
                        ElseIf Not String.IsNullOrEmpty(ViewBag.CreateUrl) Then
                            @<li><a href="@ViewBag.CreateUrl"><i class="icon-plus"></i>&nbsp;Создать</a></li>
                        End If
                        <li class="divider-vertical"></li>
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user"></i>&nbsp;@User.Identity.Name<b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li>@Html.ActionLink("Управление", "manage", "account", New With {.area = String.Empty}, Nothing)</li>
                                <li>@Html.ActionLink("Выйти", "logoff", "account", New With {.area = String.Empty, .returnUrl = Request.Url.AbsolutePath}, Nothing)</li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
End If
